<extend name="Public:template" />
<block name="page_body">
<div class="row  mt10" >
	<div class="span20">
		<ul class="breadcrumb" >
			<li>当前位置：<a href="{:U('tuangou/index')}">预购区</a> <span class="divider">/</span></li>
			<li class="active">{$page_title}</li>
		</ul>
	</div>
</div>
<form action="{:U('Tuangou/showConfirm')}" method="get" id="form_add" name="form_add" role="form">
<input type="hidden" name="prod_id" value="{$detail.prod_id}">
<div class="row">
	<div class="span6">
		<a class="pull-left thumbnail " style="width:240px;height:240px" href="#">
 			<img class="media-object" src="{$detail.prod_pic}" style="width:240px;height:240px">
		</a>
	</div>
	<div class="span14">
		<h4 class="media-heading">{$detail.title}</h4>
		<h5>规格：<span class="label label-info mt5">{$detail.prod_spec}</span></h5>
		<hr class="mt-10">
		<div class="price">
			<div style="font-weight:600;color:#666666;font-size:14px">参  考  价：<span class="old" >¥{$detail.price_sale}</span></div>
			<div class="mt10" style="font-weight:600;color:#666666;font-size:14px">利  客  价：<span class="now" style="font-size:18px">¥{$detail.price_real}</span></div>
			<div class="mt10" style="font-weight:600;color:#666666;font-size:14px">利  客  送：免运费，货到付款，当面验货，不满意立即退</div>
			<hr>
			<if condition="$detail['is_show'] eq 1">
				<div class="input-prepend input-append">
					<button type="button" class="btn btn-large"  onclick="addNum('-1');">-</button>
					<input type="text"  class="input-micro" style="height:34px;width:50px" id="prodNum" name="num" value="1"/>
					<button type="button" class="btn btn-large"  onclick="addNum('1');">+</button>
					<button type="submit" class="btn btn-large btn-warning" ><i class="icon-white icon-shopping-cart"></i>立即预订</button>
				</div>
			<else/>
				<div class="mt20">
					<span class="label alert-danger">该商品已下架</span>
				</div>
			</if>
		</div>
	</div>
</div>
</form>
<div class="row">
	<div class="span16 mt-20">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#"><h4>商品详细</h4></a></li>
		</ul>
		<div id="prod_content"></div>
		<div class="text-center">
			<img src="http://imgout.ph.126.net/22361021/footer_yugouqu.jpg" >
		</div>
	</div>
	<div class="span4 mt20" id="otherList">
		<ul class="thumbnails mt20">
			<volist name="prodData.list" id="val">
			<li class="span4">
				<div class="thumbnail text-center">
					<img src="{$val.prod_pic}" class="pic160" alt="{$val.name}">
					<h5><a href="{:U('Tuangou/showDetail',array('prod_id'=>$val['prod_id']))}" target="_blank">{$val.name} {$val.spec}</a></h5>
					<p class="price"><span class="now">￥{$val.price_real}</span><span class="old">￥{$val.price_sale}</span></p>
					<p ><button type="button" class="btn btn-info btn-small" onclick="redirect('{:U('Tuangou/showDetail',array('prod_id'=>$val['prod_id']))}')"><i class="icon-white icon-search"></i>查看详细</button></p>
				</div>
			</li>
			</volist>
		</ul>
	</div>
</div>
<!-- 商品列表页面  -->
</block>
<block name="script_footer">
<script type="text/javascript">
$(function(){
	$('#page_tg').siblings().removeClass('active');
	$('#page_tg').addClass('active');
	loadDetail();
	
	$('#otherList .thumbnails').carouFredSel({
		items:{
			visible:6
		},
		scroll: {
			items:4,
			duration: 1000,
			timeoutDuration: 8000
		},
		auto: {
			pauseOnHover: 'resume'
		},
		direction:'up'
	});	
	
})

function loadDetail(){
	var prod_id = "{$detail.prod_id}";
	$.ajax({
        'url': "/Tuangou/showContent",
        'dataType': "json",
        'data': {'prod_id':prod_id},
        'success': function (data) {
        	if(data['error']=='0'){
            	$("#prod_content").html(data['content']);
        	}else{
        		alert(data['message']);
        	}
        }
    });
}
function addNum(num){
	var cur = parseInt($('#prodNum').val());
	var total = cur + parseInt(num);
	if(total <= 0){
		total = 1;
	}
	$('#prodNum').val(total);
	
}

</script>
</block>